PROJECTENGRAM

[REV] CSALGCM COMPREHENSIVE FINALS REVIEWER

Tags: #◇Computer Science #◇CSALGCM #◇Algorithms #◇Complexity Theory #◇Reviewer #◇Finals


CSALGCM Comprehensive Finals Reviewer

◇Overview

This reviewer synthesizes Algorithms and Advanced Complexity (CSALGCM). Subjects cover computational complexity analysis (Asymptotic notations O,Ω,ΘO, \Omega, \Theta, recurrence relations via Master Theorem, Recursion Tree, and Substitution methods), Divide and Conquer paradigms (MergeSort, QuickSort, Closest Pair of Points, Strassen's Matrix Multiplication), Dynamic Programming (optimal substructure, overlapping subproblems, memoization vs tabulation: 0/1 Knapsack, Longest Common Subsequence, Matrix Chain Multiplication, Levenshtein Edit Distance), Greedy Algorithms (Greedy Choice Property, Exchange Arguments: Fractional Knapsack, Huffman Coding, Activity Selection, Job Sequencing), and Computational Intractability (Decision problems, P, NP, NP-Completeness, polynomial-time reductions ≤P\le_P, Cook-Levin theorem, 3-SAT, Vertex Cover, Independent Set, Hamiltonian Cycle, TSP).


◇1. Master Theorem Recurrence Matrix

For recurrences of the standard form T(n)=aT(n/b)+f(n)T(n) = a T(n/b) + f(n) with a≥1,b>1a \ge 1, b > 1:
Let ccrit=log⁡b(a)c_{\text{crit}} = \log_b(a).

CaseCondition on f(n)f(n)Solution T(n)T(n)Dominant Cost
Case 1f(n)=O(nc)f(n) = O(n^{c}) where c<ccritc < c_{\text{crit}}Θ(nlog⁡ba)\Theta(n^{\log_b a})Tree Leaves dominate
Case 2f(n)=Θ(nccritlog⁡kn)f(n) = \Theta(n^{c_{\text{crit}}} \log^k n) for k≥0k \ge 0Θ(nlog⁡balog⁡k+1n)\Theta(n^{\log_b a} \log^{k+1} n)Evenly distributed across all levels
Case 3f(n)=Ω(nc)f(n) = \Omega(n^c) where c>ccritc > c_{\text{crit}} AND af(n/b)≤kf(n)a f(n/b) \le k f(n)Θ(f(n))\Theta(f(n))Tree Root dominates

◇2. Dynamic Programming Formulations


◇3. Complexity Classes & Reduction Hierarchy

  • P: Problems solvable in deterministic polynomial time O(nk)O(n^k).
  • NP: Decision problems verifiable by a deterministic Turing machine in polynomial time given a certificate.
  • NP-Complete: L∈NPL \in \text{NP} and ∀L′∈NP,L′≤PL\forall L' \in \text{NP}, L' \le_P L.
  • Reduction Rule: If A≤PBA \le_P B and B∈P  ⟹  A∈PB \in \text{P} \implies A \in \text{P}. If A≤PBA \le_P B and AA is NP-hard   ⟹  B\implies B is NP-hard!

◇4. High-Yield Exam Checklist

  • In the Master Theorem, can you apply it if b≤1b \le 1 or a<1a < 1? NO.
  • What is the time complexity of the 0/1 Knapsack DP algorithm? Pseudo-polynomial O(nW)O(n W) (polynomial in nn and magnitude of WW, but exponential in the number of bits of WW).
  • To prove a new problem YY is NP-Complete, what must you reduce? Reduce a known NP-Complete problem XX to YY (X≤PYX \le_P Y), NOT Y→XY \to X!
  • Does Fractional Knapsack require dynamic programming? NO, it is solved greedily by sorting by value-to-weight ratio vi/wiv_i / w_i in O(nlog⁡n)O(n \log n).
  • What is the optimal prefix code length metric in Huffman coding? Weighted average path length ∑fi⋅length(ci)\sum f_i \cdot \text{length}(c_i).

◇References & Navigation

CONFIRMATION // 理解度の確認

ACTIVE RECALL VERIFICATION

Select an answer to verify conceptual comprehension and reveal the technical rationale.

Q1

Using the Master Theorem, what is the asymptotic solution to the recurrence T(n)=4T(n/2)+n2T(n) = 4 T(n/2) + n^2?

Q2

What property allows a problem to be solved efficiently using Dynamic Programming rather than recalculating subproblems repeatedly?

Q3

Which problem is solvable in polynomial time using a greedy algorithm based on value-to-weight ratio?

Q4

To prove that a new decision problem BB is NP-Complete, which two steps are required?

Q5

In Matrix Chain Multiplication of 4 matrices with dimensions 10×100×5×50×110 \times 100 \times 5 \times 50 \times 1, what does the entry m[i,j]m[i, j] represent in the DP table?

[REV] CSALGCM Comprehensive Finals Reviewer | PROJECT ENGRAM